//
//  NYExamineCell.m
//  NiuWaJiaoYu
//
//  Created by MinLison on 2018/1/9.
//  Copyright © 2018年 niuwaketang. All rights reserved.
//

#import "NYExamineCell.h"
@interface NYExamineCell ()
@property(nonatomic, strong) UIImageView *arrowImgView;
@property(nonatomic, strong) TTTAttributedLabel *titleLabel;
@end
@implementation NYExamineCell
+ (CGFloat)heightForObject:(id)object identifier:(NSString *)identifier atIndexPath:(NSIndexPath *)indexPath tableView:(UITableView *)tableView
{
        return __WGHeight(45);
}
- (BOOL)shouldUpdateCellWithObject:(id)object
{
        self.model = object;
        return YES;
}

- (void)setModel:(NYExamineModel *)model
{
        _model = model;
        [self updateContent];
}
- (void)updateContent
{
        self.titleLabel.text = self.model.ex_title;
}
- (void)setupView
{
        [super setupView];
        [self.contentView addSubview:self.arrowImgView];
        [self.contentView addSubview:self.titleLabel];
        [self.arrowImgView mas_remakeConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(self.contentView);
                make.right.equalTo(self.contentView).offset(-__WGWidth(15));
        }];
        [self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
                make.edges.equalTo(self.contentView).valueOffset([NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(0, __WGWidth(15), 0, 0)]);
        }];
}

- (UIImageView *)arrowImgView
{
        if (_arrowImgView == nil) {
                _arrowImgView = [[UIImageView alloc] initWithImage:[UIImage jian_tou]];
        }
        return _arrowImgView;
}
- (TTTAttributedLabel *)titleLabel
{
        if (_titleLabel == nil) {
                _titleLabel = [[TTTAttributedLabel alloc] initWithFrame:CGRectZero];
                _titleLabel.font = WGSystem14Font;
                _titleLabel.textColor = UIColorHex(0x666666);
                _titleLabel.textInsets = UIEdgeInsetsMake(0, 0, 0, __WGWidth(20));
                _titleLabel.qmui_borderPosition = QMUIBorderViewPositionBottom;
        }
        return _titleLabel;
}
@end
